<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>数据上报系统</title>
		<link rel="stylesheet" type="text/css" href="/report/Public/Home/css/index.css" />
		<link rel="stylesheet" href="/report/Public/Home/css/list.css" />
		<script src="/report/Public/assets/js/jquery.min.js"></script>
		<script src="/report/Public/assets/js/jquery.form.js"></script>
		<script src="/report/Public/Home/js/table_411.js"></script>
		<script src="/report/Public/Home/js/table_409.js"></script>
		<script src="/report/Public/Home/js/table_410.js"></script>
		<script src="/report/Public/Home/js/table_414.js"></script>
<!--		<script src="/report/Public/Home/js/jquery.json.js"></script>
		<script src="/report/Public/Home/js/jstorage.js"></script>
		<script src="/report/Public/Home/js/jquery.formStorage.js"></script>-->
		<script src="/report/Public/layer/layer.js"></script>
		<script src="/report/Public/assets/js/bootstrap.js"></script>		
		<link rel="stylesheet" href="/report/Public/assets/css/bootstrap.css" />
	</head>

	<body>

		<div class="row rowList rowHeader">
			<div class="header1">
				<span class="myIcon" style="margin-right: 5px;">&#xe626;</span>你好，<span id="userName"><?php echo $_SESSION['c_user'] ?></span>！
				<a style="color:white;text-decoration: none;" href="<?php echo U('index/loginout');?>"><span id="cancel"><span class="myIcon">&#xe611;</span>注销</span></a>
			</div>
			<div class="">
				<img style="height: 40px; margin: 10px 0;" src="/report/Public/Home/img/logo2.png" />
			</div>

		</div>

		                                <div class="modal fade" id="city" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">
                                        选择国内城市
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                        <div class="col-xs-12">
                                        <form>
                                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">


                                    <tr>
                                        <td height="30"  style="border-bottom:#CCCCCC solid 1px; line-height:25px; background-color:#F4F8FB">
                                            <label>
                                                <input type="checkbox" class="ace ace-checkbox-2"  id='chkAll' onclick='CheckAll(this.form)' value="全选"/>
                                                <span class="lbl"> 全选</span>
                                            </label>
                                        </td>


                                    </tr>
                                    <tr>


                                            <td class="company_info" height="30" style="padding-left:70px;border-bottom:#E7EBF8 dashed 1px; color:#666666">

                                                <?php if(is_array($city)): $i = 0; $__LIST__ = $city;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="thopen">
                                                        <input name="city[]" class="ace ace-checkbox-2 checkbox-child" type="checkbox"  id="<?php echo ($vo["id"]); ?>" value="<?php echo ($vo["name"]); ?>"  />
                                                    <span class="lbl" style="margin-right:10px;"><?php echo ($vo["name"]); ?></span>
                                                    </label><?php endforeach; endif; else: echo "" ;endif; ?>

                                            </td>


                                    </tr>

                                </table>
                                </form>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <input type="button" id="cityadd" class="btn btn-primary" data-id=""  value="插入"/>
    
                                    <button type="button" class="btn btn-default" data-dismiss="modal">
                                        关闭
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                </div>
                </div>
                                <div class="modal fade" id="goods" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">
                                        选择商品分类
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                        <div class="col-xs-12">
                                        <form>
                                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">


                                    <tr>
                                        <td height="30"  style="border-bottom:#CCCCCC solid 1px; line-height:25px; background-color:#F4F8FB">
                                            <label>
                                                <input type="checkbox" class="ace ace-checkbox-2"  id='chkAll' onclick='CheckAll(this.form)' value="全选"/>
                                                <span class="lbl"> 全选</span>
                                            </label>
                                        </td>


                                    </tr>
                                    <tr>


                                            <td class="company_info" height="30" style="padding-left:70px;border-bottom:#E7EBF8 dashed 1px; color:#666666">

                                                <?php if(is_array($goods)): $i = 0; $__LIST__ = $goods;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="thopen">
                                                        <input name="goods[]" class="ace ace-checkbox-2 checkbox-child" type="checkbox"  id="<?php echo ($vo["id"]); ?>" value="<?php echo ($vo["name"]); ?>"  />
                                                    <span class="lbl" style="margin-right:10px;"><?php echo ($vo["name"]); ?></span>
                                                    </label><?php endforeach; endif; else: echo "" ;endif; ?>

                                            </td>


                                    </tr>

                                </table>
                                </form>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <input type="button" id="goodsadd" class="btn btn-primary" data-id=""  value="插入"/>
    
                                    <button type="button" class="btn btn-default" data-dismiss="modal">
                                        关闭
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                </div>
                <div class="modal fade" id="country" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">
                                        选择国家地区
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                        <div class="col-xs-12">
                                        <form>
                                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">


                                    <tr>
                                        <td height="30"  style="border-bottom:#CCCCCC solid 1px; line-height:25px; background-color:#F4F8FB">
                                            <label>
                                                <input type="checkbox" class="ace ace-checkbox-2"  id='chkAll' onclick='CheckAll(this.form)' value="全选"/>
                                                <span class="lbl"> 全选</span>
                                            </label>
                                        </td>


                                    </tr>
                                    <tr>


                                            <td class="company_info" height="30" style="padding-left:70px;border-bottom:#E7EBF8 dashed 1px; color:#666666">

                                                <?php if(is_array($country)): $i = 0; $__LIST__ = $country;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="thopen">
                                                        <input name="country[]" class="ace ace-checkbox-2 checkbox-child" type="checkbox"  id="<?php echo ($vo["id"]); ?>" value="<?php echo ($vo["name"]); ?>"  />
                                                    <span class="lbl" style="margin-right:10px;"><?php echo ($vo["name"]); ?></span>
                                                    </label><?php endforeach; endif; else: echo "" ;endif; ?>

                                            </td>


                                    </tr>

                                </table>
                                </form>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <input type="button" id="countryadd" class="btn btn-primary" data-id=""  value="插入"/>
    
                                    <button type="button" class="btn btn-default" data-dismiss="modal">
                                        关闭
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                </div>


		<div class="row rowB">
			<div class="rowL">
				<ul id="state">
					<li>
						<div class="stateType">
							新报表任务
						</div>
						<ul class="list">
                            <?php if(is_array($w_table)): $i = 0; $__LIST__ = $w_table;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="">
									<?php if($v['id'] != $info['id']): ?><a style="text-decoration: none;" href="<?php echo U('index/table',array('id'=>$v['id']));?>"><?php endif; ?>
										<div class="listType"><?php echo ($v["title"]); ?>(<?php echo ($v["year"]); ?>年<?php echo ($v["quarter"]); ?>季度)</div>
									<?php if($v['id'] != $info['id']): ?></a><?php endif; ?>
										<ul class="listDetail" <?php if($v['id'] == $info['id']): ?>style="display:block;"<?php endif; ?> >
											<li class="chooseLi">在线填报</li>
										</ul>

                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>

					</li>
				<li>
					<div class="stateType">
						审核中
					</div>
					<ul class="list">
						<?php if(is_array($d_table)): $i = 0; $__LIST__ = $d_table;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="">
								<a style="text-decoration: none;" href="<?php echo U('index/d_table',array('id'=>$v['id']));?>">
									<div class="listType"><?php echo ($v["title"]); ?>(<?php echo ($v["year"]); ?>年<?php echo ($v["quarter"]); ?>季度)</div>
								</a>
							</li><?php endforeach; endif; else: echo "" ;endif; ?>
					</ul>

				</li>
				<li>
					<div class="stateType">
						未通过
					</div>
					<ul class="list">
						<?php if(is_array($n_table)): $i = 0; $__LIST__ = $n_table;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="">
								<a style="text-decoration: none;" href="<?php echo U('index/n_table',array('id'=>$v['id']));?>">
									<div class="listType"><?php echo ($v["title"]); ?>(<?php echo ($v["year"]); ?>年<?php echo ($v["quarter"]); ?>季度)</div>
								</a>
							</li><?php endforeach; endif; else: echo "" ;endif; ?>
					</ul>

				</li>
				<li>
					<div class="stateType">
						已过期
					</div>
					<ul class="list">
						<?php if(is_array($e_table)): $i = 0; $__LIST__ = $e_table;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="">
								<a style="text-decoration: none;" href="<?php echo U('index/e_table',array('id'=>$v['id']));?>">
									<div class="listType"><?php echo ($v["title"]); ?>(<?php echo ($v["year"]); ?>年<?php echo ($v["quarter"]); ?>季度)</div>
								</a>
							</li><?php endforeach; endif; else: echo "" ;endif; ?>
					</ul>

				</li>
					<li>
						<div class="stateType">
							历史报表
						</div>
						<ul class="list list2">
                            <?php if(is_array($y_table)): $i = 0; $__LIST__ = $y_table;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$y): $mod = ($i % 2 );++$i;?><li class="">
									<a style="text-decoration: none;" href="<?php echo U('index/w_table',array('id'=>$y['id']));?>">
                                    	<div class="listType"><?php echo ($y["title"]); ?>(<?php echo ($y["year"]); ?>年<?php echo ($y["quarter"]); ?>季度)</div>
									</a>
                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>

					</li>
				</ul>
			</div>



			<div class="rowR">
				<!--在线填写-->
				<div id="onLine"   style="display: block;">

					<form action="<?php echo U('online_run');?>" method="post" id="form1" >
						<input type="hidden" id="tableid" name="tableid" value="<?php echo ($info["id"]); ?>" >
						<div id="tableDetail">
							<div class="title">
								<div class="titltLeft">
									<h3><?php echo ($info['title']); ?>(<?php echo ($info['code']); ?>表)</h3>
								</div>

							</div>
							<div>
								<div class="unit"  style="float: left;margin-top: 80px">
									填报单位：<?php echo ($info['target']); ?>
									&nbsp;
									<span>年份季度：<?php echo ($info['year']); ?>年<?php if($info['quarter'] == 1): ?>1<?php else: ?>1-<?php echo ($info['quarter']); endif; ?>季度</span>
								</div>
								<div class="titltRight"  style="float: right;">
									<ul>
										<li>表&emsp;&emsp;号：<?php echo ($info['code']); ?>表</li>
										<li>制定机关：</li>
										<li>批准机关：</li>
										<li>批准文号：</li>
										<li>有效期至：<?php echo (date("y-m-d",$info["endtime"])); ?></li>
									</ul>
								</div>
							</div>

							<div id="table">

								<table border="1" cellspacing="0" cellpadding="0" width="100%" frame="hsides">
									<tbody>
									<tr class="level1">
										<td width="30%">指标名称</td>
										<td width="10%">计量单位</td>
										<td width="10%">代码</td>
										<td width="25%">上年<?php if($info['quarter'] == 1): ?>1<?php else: ?>1-<?php echo ($info['quarter']); endif; ?>季度</td>
										<td width="25%">本年<?php if($info['quarter'] == 1): ?>1<?php else: ?>1-<?php echo ($info['quarter']); endif; ?>季度</td>
									</tr>
									<tr class="level1">
										<td>甲</td>
										<td>乙</td>
										<td>丙</td>
										<td>1</td>
										<td>2</td>
									</tr>

									<?php if(is_array($res)): foreach($res as $key=>$v): ?><tr <?php if($v["code"] == '--'): ?>class="level1"<?php else: ?>class="level2"<?php endif; ?>>
											<td><?php echo ($v["name"]); ?></td>
											<td><?php echo ($v["metering"]); ?></td>
											<td><?php echo ($v["code"]); ?></td>

											<?php if($key == 'd5'): ?><td>
                                                <select style="width: 100%;" name="last[]">
                                                    <option value="">选择类别</option>
                                                    <?php if(is_array($xj_type)): $i = 0; $__LIST__ = $xj_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><option <?php if($vv['name'] == $v['last']): ?>selected="selected"<?php endif; ?> value="<?php echo ($vv["name"]); ?>"><?php echo ($vv["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                    
                                                    
                                                </select>
                                            </td>

                                            <td>
                                                <select style="width: 100%;" name="now[]">
                                                    <option value="">选择类别</option>
                                                    <?php if(is_array($xj_type)): $i = 0; $__LIST__ = $xj_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><option <?php if($vv['name'] == $v['now']): ?>selected="selected"<?php endif; ?> value="<?php echo ($vv["name"]); ?>"><?php echo ($vv["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                    
                                                    
                                                </select>
                                            </td>

											<?php elseif($key == 'd6'): ?>
												<td>
                                                <select style="width: 100%;" name="last[]">
                                                    <option value="">选择类别</option>
                                                    <?php if(is_array($zn_type)): $i = 0; $__LIST__ = $zn_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pp): $mod = ($i % 2 );++$i;?><option <?php if($pp['name'] == $v['last']): ?>selected="selected"<?php endif; ?> value="<?php echo ($pp["name"]); ?>"><?php echo ($pp["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                </select>
                                            </td>

                                            <td>
                                                <select style="width: 100%;" name="now[]">
                                                    <option value="">选择类别</option>
                                                    <?php if(is_array($zn_type)): $i = 0; $__LIST__ = $zn_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pp): $mod = ($i % 2 );++$i;?><option <?php if($pp['name'] == $v['now']): ?>selected="selected"<?php endif; ?> value="<?php echo ($pp["name"]); ?>"><?php echo ($pp["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                </select>
                                            </td>
											<?php else: ?>

											<td><input <?php if($v["last"] == '--'): ?>readonly="readonly"<?php endif; ?> style="width: 100%;" id="last_<?php echo ($key); ?>" name="last[]" onFocus="choose(<?php if($v["catgory"] == ''): ?>'other'<?php else: ?>'<?php echo ($v["catgory"]); ?>'<?php endif; ?>,'last_'+'<?php echo ($key); ?>')" value="<?php echo ($v["last"]); ?>" type="text" /></td>
											<td><input <?php if($v["now"] == '--'): ?>readonly="readonly"<?php endif; ?>  style="width: 100%;" id="now_<?php echo ($key); ?>" name="now[]" onFocus="choose(<?php if($v["catgory"] == ''): ?>'other'<?php else: ?>'<?php echo ($v["catgory"]); ?>'<?php endif; ?>,'now_'+'<?php echo ($key); ?>')"  value="<?php echo ($v["now"]); ?>" type="text"  /></td><?php endif; ?>

											


										</tr><?php endforeach; endif; ?>
									</tbody>
								</table>

							</div>
							<div class="footer">
								<p>补充说明：<span><?php echo ($info["remark"]); ?></span></p>
								<p>报送日期和方式：<span>2017年4月10日前，2,3,4季度于季后15日前，电子邮件和加盖公章的纸介质，季报</span></p>
								<p>
									<ul class="info">
										<li style="width: 25%;">
											单位负责人：<input style="width: 50%;" type="text"  name="fz" id="fz" value="<?php echo ($info["fz"]); ?>" />
										</li>
                                        <li style="width: 25%;">
                                            联系人：<input style="width: 50%;" type="text"  name="lx" id="lx" value="<?php echo ($info["lx"]); ?>" />
                                        </li>
										<li style="width: 25%;">
											填表人：<input style="width: 50%;" type="text"  name="tb" id="tb" value="<?php echo ($info["tb"]); ?>" />
										</li>
										<li style="width: 25%;">
											报出日期：<?php echo (date('Y',$info["add_time"])); ?>年<?php echo (date('m',$info["add_time"])); ?>月<?php echo (date('d',$info["add_time"])); ?>日
										</li>
									</ul>
								</p>
							</div>
						</div>
						<div class="clearFLoat">
							<button id="submit"><span class="myIcon">&#xe613;</span>上传数据</button>

						</div>
                        <button class="save" type="button" id="store">保存</button>
<!--                        <button class="save" type="button" id="restore">读取缓存</button>
                        <button class="save" type="button" id="destroy">清空缓存</button>-->
					</form>

				</div>

			</div>
		</div>

		<script type="text/javascript" src="/report/Public/Home/js/list1.js"></script>
	</body>
<script>

	        function choose(datatype,id){
            if (datatype == 'goods') {
                $('#goods').modal('show');
                $('#goodsadd').attr('data-id',id);
                return false;
            }else if(datatype == 'city'){
                $('#city').modal('show');
                $('#cityadd').attr('data-id',id);
                return false;
            }else if(datatype == 'country'){
                $('#country').modal('show');
                $('#countryadd').attr('data-id',id);
                return false;
            }
            
        }

        function CheckAll(form){
            for (var i=0;i<form.elements.length;i++){
                var e = form.elements[i];
                if (e.Name != 'chkAll'&&e.disabled==false)
                    e.checked = form.chkAll.checked;
            }
        }
        $('#countryadd').on('click',function(){
            var str = '';
            $.each($('input[name="country[]"]:checked'),function() {
                    str += $(this).val()+'、';
            });
            var id = $('#countryadd').attr('data-id');
            document.getElementById(id).value=str;
            $('#country').modal('hide');
        })

        $('#cityadd').on('click',function(){
            var str = '';
            $.each($('input[name="city[]"]:checked'),function() {
                    str += $(this).val()+'、';
            });
            var id = $('#cityadd').attr('data-id');
            document.getElementById(id).value=str;
            $('#city').modal('hide');
        })

        $('#goodsadd').on('click',function(){
            var str = '';
            $.each($('input[name="goods[]"]:checked'),function() {
                    str += $(this).val()+'、';
            });
            var id = $('#goodsadd').attr('data-id');
            document.getElementById(id).value=str;
            $('#goods').modal('hide');
        })




	$(function(){

		var app = '/report/index.php';
		$('#store, #restore, #destroy').on('click', function() {
			var aaa = new Array();
			var bbb = new Array();
			var tableid = $('#tableid').val();
			$("input[name='last[]']").each(function () {
				aaa.push($(this).val());
			})
			$("input[name='now[]']").each(function () {
				bbb.push($(this).val());
			})
			$.ajax({
				type: "post",
				url: app+"/Home/Index/save_table", // 获取一级分类
				data: {"tableid":tableid,"last":aaa,"now":bbb},
				dataType: "json",
				async:false,
				success: function(data) {
					//alert(JSON.stringify(data));
					if (data.state==1)
					{
						//操作成功
						layer.msg(data.msg, {
							icon: 1,
							time: 1000 //1秒关闭（如果不配置，默认是3秒）
						});
					}else
					{
						//操作失败
						layer.msg(data.msg, {
							icon: 1,
							time: 1000 //1秒关闭（如果不配置，默认是3秒）
						});
					}

				},
				error:function(err){
					//alert(JSON.stringify(err));
				}
			});
			//本地缓存功能
/*			if(this.id == 'store')
				$('#form1').formStore();
			else if(this.id == 'restore')
				$('#form1').formRestore();
			else
				$('#form1').destroyStore();*/
		});

		$('#form1').ajaxForm({
			beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
			success: complete, // 这是提交后的方法
			dataType: 'json'
		});

		$('#form2').ajaxForm({
			beforeSubmit: checkForm1, // 此方法主要是提交前执行的方法，根据需要设置
			success: complete, // 这是提交后的方法
			dataType: 'json'
		});

		$('#excel').change(function () {
			var filepath = $("input[name='excel']").val();
			var extStart = filepath.lastIndexOf(".");
			var ext = filepath.substring(extStart, filepath.length).toUpperCase();
			if (ext != ".XLS" && ext != ".XLSX") {
				layer.alert("excel限于xls,xlsx格式", {icon: 5});
				return false;
			}
			/*                file_size = this.files[0].size;
			 var size = file_size / 1024;
			 if (size > 10240) {
			 layer.alert("上传的excel大小不能超过10M！", {icon: 5});
			 return false;
			 }*/
		});
		
		function checkForm() {
			if ('' == $.trim($('#fz').val())){
				layer.alert("请填写单位负责人", {icon: 5},function(index){
					layer.close(index);
					$('#fz').focus();
				});
				return false;
			}

            if ('' == $.trim($('#lx').val())){
                layer.alert("请填写联系人", {icon: 5},function(index){
                    layer.close(index);
                    $('#lx').focus();
                });
                return false;
            }

			if ('' == $.trim($('#tb').val())){
				layer.alert("请填写填表人", {icon: 5},function(index){
					layer.close(index);
					$('#tb').focus();
				});
				return false;
			}

			if ('<?php echo ($info["code"]); ?>' == 'CDTLG411'){

                var info = check_411();
				if(info != ''){
					layer.alert(info, {icon: 5},function(index){
						layer.close(index);
					});
					return false;
				}
            }else if('<?php echo ($info["code"]); ?>' == 'CDTLG414'){

					var info = check_414();
					if(info != ''){
						layer.alert(info, {icon: 5},function(index){
							layer.close(index);
						});
						return false;
					}
			}else if('<?php echo ($info["code"]); ?>' == 'CDTLG410'){

				var info = check_410();

				if(info != ''){
					layer.alert(info, {icon: 5},function(index){
						layer.close(index);
					});
					return false;
				}
			}else if('<?php echo ($info["code"]); ?>' == 'CDTLG409'){
                var info = check_409();
                if(info != ''){
                    layer.alert(info, {icon: 5},function(index){
                        layer.close(index);
                    });
                    return false;
                }
            }

		}

		function checkForm1(){
			var filepath = $("input[name='excel']").val();
			var extStart = filepath.lastIndexOf(".");
			var ext = filepath.substring(extStart, filepath.length).toUpperCase();
			if (ext != ".XLS" && ext != ".XLSX") {
				layer.alert("excel限于xls,xlsx格式", {icon: 5});
				return false;
			}


			if ('' == $.trim($('#fz1').val())){
				layer.alert("请填写单位负责人", {icon: 5},function(index){
					layer.close(index);
					$('#fz1').focus();
				});
				return false;
			}

            if ('' == $.trim($('#lx1').val())){
                layer.alert("请填写联系人", {icon: 5},function(index){
                    layer.close(index);
                    $('#lx1').focus();
                });
                return false;
            }

			if ('' == $.trim($('#tb1').val())){
				layer.alert("请填写填表人", {icon: 5},function(index){
					layer.close(index);
					$('#tb1').focus();
				});
				return false;
			}
			/*file_size = this.files[0].size;
			 var size = file_size / 1024;
			 if (size > 10240) {
			 layer.alert("上传的excel大小不能超过10M！", {icon: 5});
			 return false;
			 }*/
		}
		function complete(data){
			if(data.status==1){
				layer.alert(data.info, {icon: 6}, function(index){
					layer.close(index);
					window.location.href=data.url;
				});
			}else{
				layer.alert(data.info, {icon: 6}, function(index){
					layer.close(index);
					return false;
				});
			}
		}

	});
</script>
</html>